package pinkblob.tools;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;

public class MappingFormatter {

	public static void main(String[] args) {
		try {
			BufferedReader in = new BufferedReader(
					new FileReader(new java.io.File("input")));
			String line;
			ArrayList<String> setter = new ArrayList<String>();
			ArrayList<String> getter = new ArrayList<String>();

			in = new BufferedReader(
					new FileReader(new java.io.File("input")));
			while ((line = in.readLine()) != null) {
				line = line.replace(";", "");
				String[] split = line.trim().split(" ");
				String getstr = "get";
				if (split[0].equals("Boolean")) getstr = "is";
				getter.add("result.put(\""+split[1]+"\",pi."+getstr+split[1]+"());");
				setter.add("if (key.equals(\""+split[1]+"\")) pi.set"+split[1]+"(("+split[0]+")data.get(key));");
			}
			for (int i = 0 ; i < setter.size(); i++) System.out.println(setter.get(i));
			for (int i = 0 ; i < setter.size(); i++) System.out.println(getter.get(i));
		} catch (Exception ex) {
			
		}
	}
}
